home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Oct⁄Nov 88 / Re- How to close a modeless ⁄ < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  35 lines  |  [TEXT/GEOL]

  1. Item    6277544                         31-Oct-88        15:16
  2.  
  3. From:   BIANCHI1                        Bianchi, Curt
  4.  
  5. To:     D2303                           Cameo Sys, Dev, Erik Swan
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Response to How to close
  10.  
  11. Hi Bruce,
  12.  
  13. Re: Closing modeless dialogs-
  14.  
  15. As someone mentioned, windows are normally closed by calling the window's
  16. CloseByUser method.  You could call CloseByUser in the appropriate DoChoice to
  17. close the window in response to clicking a button.  When CloseByUser returns,
  18. the window and its subviews are free'd but the methods are not.  That means you
  19. can't refer to any of the fields or instance variables of any of the views
  20. after the CloseByUser call but the code will still execute and DoChoice will
  21. return to its caller etc.  The important point is to not refer to any fields of
  22. objects that will have been free'd as a result of calling CloseByUser.  (I
  23. haven't tried this myself so I can't state with certainty that whether MacApp
  24. will try to refer to fields of the free'd objects.)
  25.  
  26. Another thing you may want to do is call the dialog view's CanDismiss method
  27. first, and call CloseByUser if CanDismiss returns true.
  28.  
  29. I hope this helps.  We'll try this ourselves, and perhaps implement a dialog of
  30. this type in DemoDialogs, to make sure we have a good solution in the future.
  31.  
  32. Curt Bianchi
  33.  
  34.  
  35.